﻿<Window x:Class="YnabCsvConverter.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" 
        Height="420" 
        Width="540" 
        WindowStyle="None" 
        WindowState="Normal" 
        AllowsTransparency="True"
        WindowStartupLocation="CenterScreen"
        ResizeMode="CanResizeWithGrip"
        Background="Transparent"
        MouseDown="HandleWindowMouseDown"
        Icon="AppIcon48.png"
        >
   <Border Margin="10" BorderBrush="{StaticResource DarkLine}" BorderThickness="1">
      <Border.Effect>
         <DropShadowEffect Color="#909090" BlurRadius="10" ShadowDepth="0" />
      </Border.Effect>
      <Grid Background="#FFFFFF">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="40" />
         </Grid.RowDefinitions>       

         <Border Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{StaticResource DarkLine}">
            <Grid Background="{StaticResource HeaderBackground}">
               <StackPanel Orientation="Horizontal">
                  <TextBlock Style="{StaticResource HeaderTextBlock}" VerticalAlignment="Bottom" Margin="10" Text="YNAB CSV Converter">
                     <TextBlock.Effect>
                        <DropShadowEffect Color="#FFFFFF" BlurRadius="1" ShadowDepth="2" Direction="-45" />
                     </TextBlock.Effect>
                  </TextBlock>

                  <TextBlock x:Name="appVersion" Style="{StaticResource LighterTextBlock}" VerticalAlignment="Bottom" Margin="0,10" Text="">
                  </TextBlock>
               </StackPanel>
            </Grid>
         </Border>

         <Grid Grid.Row="1">
            <StackPanel Orientation="Vertical">

               <StackPanel Orientation="Horizontal" Margin="10,10,10,10">
                  <Image Margin="0" Source="AppIcon48.png" Width="48" Height="48" />

                  <StackPanel Margin="10,0,0,0" Orientation="Vertical">
                     <TextBlock Style="{StaticResource HeadlineTextBlock}">Convert to YNAB csv file.</TextBlock>

                     <TextBlock  Style="{StaticResource ParagraphTextBlock}" TextWrapping="Wrap">
                     This Tool converts csv files to a YNAB (4.x) importable csv file. <LineBreak/>
                     This software is free, see <Hyperlink Foreground="{StaticResource AccentBrush}" RequestNavigate="HandleHyperlinkRequestNavigate" NavigateUri="http://ynabcsvconverter.codeplex.com/">http://ynabcsvconverter.codeplex.com/</Hyperlink> 
                     </TextBlock>
                  </StackPanel>

               </StackPanel>

               <!-- SOURCE -->
               <TextBlock Margin="10" Style="{StaticResource LabelTextBlock}">Source CSV File...</TextBlock>

               <Grid Height="25" Margin="10,0,10,10">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="Auto" MinWidth="100" />
                  </Grid.ColumnDefinitions>

                  <Border Grid.Column="0" Height="25" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="{StaticResource DarkLine}">
                     <TextBox x:Name="_tbSource" HorizontalAlignment="Stretch"></TextBox>
                  </Border>
                  <Button Grid.Column="1" Margin="10,0" Click="HandleSelectSourceCsvFile" MinWidth="80">Choose</Button>
               </Grid>

               <!-- TYPE -->
               <TextBlock Margin="10" Style="{StaticResource LabelTextBlock}">Type of Source CSV File...</TextBlock>

               <Grid Height="25" Margin="10,0,10,10">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="Auto" MinWidth="100" />
                  </Grid.ColumnDefinitions>

                  <ComboBox 
                     x:Name="_cbConverters"
                     Grid.Column="0" 
                     Margin="0" 
                     ItemTemplate="{StaticResource ConverterItemTemplate}"
                     ItemsSource="{Binding Converters}">
                     <ComboBox.ItemContainerStyle>
                        <Style TargetType="{x:Type ComboBoxItem}">
                           <Setter Property="Foreground" Value="#7D7D7D" />
                           <Setter Property="Margin" Value="5"/>
                           <Setter Property="Template" Value="{StaticResource ConverterDetailItemTemplate}" />
                           
                           <Style.Triggers>
                              <Trigger Property="IsMouseOver" Value="True">
                                 <Setter Property="Foreground" Value="Black" />
                              </Trigger>
                           </Style.Triggers>

                        </Style>
                     </ComboBox.ItemContainerStyle>
                  </ComboBox>
               </Grid>


               <!-- TARGET -->
               <TextBlock Margin="10,10,10,10" Style="{StaticResource LabelTextBlock}">Save YNAB CSV File as...</TextBlock>

               <Grid Height="25" Margin="10,0,10,10">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*" />
                     <ColumnDefinition Width="Auto" MinWidth="100" />
                  </Grid.ColumnDefinitions>

                  <Border Grid.Column="0" Height="25" HorizontalAlignment="Stretch" BorderThickness="1" BorderBrush="{StaticResource DarkLine}">
                     <TextBox x:Name="_tbTarget" HorizontalAlignment="Stretch">c:\source.ynab.csv</TextBox>
                  </Border>
                  <Button Grid.Column="1" Margin="10,0" Click="HandleSelectTargetCsvFile" MinWidth="80">Choose</Button>
               </Grid>

            </StackPanel>


         </Grid>

         <Border Grid.Row="2" BorderThickness="0,1,0,0" BorderBrush="{StaticResource DarkLine}">
            <Grid Background="{StaticResource HeaderBackground}" >

               <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                  <Button Margin="5" Click="HandleConvertClick" MinWidth="80">Convert</Button>
                  <Button Margin="5" Click="HandleCloseClick" MinWidth="80">Close</Button>
               </StackPanel>

            </Grid>
         </Border>
       </Grid>
   </Border>
</Window>
